public class Solution168 {
    public String convertToTitle(int columnNumber) {
        StringBuilder stringBuilder=new StringBuilder();
        while(columnNumber>0){
            if (columnNumber%26==0){
                stringBuilder.insert(0,'Z');
                columnNumber=columnNumber/26-1;
            }else{
                stringBuilder.insert(0,(char)(columnNumber%26-1+'A'));
                columnNumber=columnNumber/26;
            }
        }
        return stringBuilder.toString();
    }

    public static void main(String[] args) {
        System.out.println(new Solution168().convertToTitle(2147483647));
    }
}
